<?php
/**
 * Created by PhpStorm.
 * User: LiuJiaJun
 * Date: 2018/12/15
 * Time: 16:23
 */

namespace service\k3\util;


class MaterielReader extends AbstractReader
{
    function setTable()
    {
        $this->table = 't_ICItem_PRT';
    }

    function setFiled()
    {
        $this->field = 'fnumber as sub_materiel_id,fname as sub_materiel_name,fmodel as format,folditemid as item_id,fpacketqty as min_quantity';
    }

    function setSql()
    {
        $suffix = sprintf('select %s from %s', $this->field, $this->table);
        $this->sql = $suffix . " where fnumber='%s'";
    }

    function setBaseSql(){
        $this->baseSql = sprintf('select top 1 %s from %s', $this->field, $this->table);
    }
}